package com.example.ftpfilesync;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import com.example.ftpfilesync.config.FtpProperties;

import javax.annotation.PostConstruct;

@SpringBootApplication
@EnableConfigurationProperties
public class FtpFileSyncApplication {

    private final FtpProperties ftpProperties;

    public FtpFileSyncApplication(FtpProperties ftpProperties) {
        this.ftpProperties = ftpProperties;
    }

    public static void main(String[] args) throws InterruptedException {
        ApplicationContext context = SpringApplication.run(FtpFileSyncApplication.class, args);
        
        // 保持应用程序运行
        System.out.println("FTP文件同步服务已启动，按 Ctrl+C 停止服务");
        Thread.currentThread().join();
    }

    @PostConstruct
    public void printConfigInfo() {
        System.out.println("FtpProperties 已加载");
    }
}